﻿@{
    ViewData["Title"] = "测试";
}
<style>
    .test p {
        color: red;
        margin: 10px;
        cursor: pointer;
    }
</style>
<div class="test">
    <h3>我的第一个视图!</h3>
    <p>欢迎 @ViewData["Name"] </p>
    <p>日期：@DateTime.Now.ToString() </p>
</div>
<script>
    let p = document.querySelector(".test p");
    p.addEventListener("click", () => {
    alert("欢迎!");
    });
</script>